<template>
  <div class="mod-home">
    <h3>{{$t('message.welcome')}}</h3>
    <!--<ul>
      <li>基于vue、element-ui构建开发，实现后台管理前端功能</li>
      <li>前后端分离，通过token进行数据交互，可独立部署</li>
      <li>主题定制，通过scss变量统一一站式定制</li>
      <li>动态菜单，通过菜单管理统一管理访问路由</li>
      <li>数据切换，通过mock配置对接口数据／mock模拟数据进行切换</li>
      <li>发布时，可动态配置CDN静态资源／切换新旧版本</li>
    </ul>-->
    <el-form :model="dataForm" ref="dataForm" label-width="150px">
      <el-form-item :label="$t('message.userName')" prop="username" :class="{ 'is-required': true }">
        <el-input v-model="dataForm.user.username" controls-position="right" :label="$t('message.userName')" disabled></el-input>
      </el-form-item>
      <el-form-item :label="$t('message.email')" prop="email" :class="{ 'is-required': true }">
        <el-input v-model="dataForm.user.email" controls-position="right" :min="0" :label="$t('message.email')" disabled></el-input>
      </el-form-item>
      <el-form-item :label="$t('message.contactWay')" prop="mobile" :class="{ 'is-required': true }">
        <el-input v-model="dataForm.user.mobile" controls-position="right" :min="0" :label="$t('message.contactWay')" disabled></el-input>
      </el-form-item>
      <el-form-item :label="$t('message.company')" prop="company" :class="{ 'is-required': true }">
        <el-input v-model="dataForm.user.company" controls-position="right" :min="0" :label="$t('message.company')" disabled></el-input>
      </el-form-item>
      <el-form-item :label="$t('message.contact')" prop="contact" :class="{ 'is-required': true }">
        <el-input v-model="dataForm.user.contact" controls-position="right" :min="0" :label="$t('message.contact')" disabled></el-input>
      </el-form-item>
      <el-form-item :label="$t('message.bankAccount')" prop="bankAccount" :class="{ 'is-required': true }">
        <el-input v-model="dataForm.user.bankAccount" controls-position="right" :min="0" :label="$t('message.bankAccount')" disabled></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        dataForm: {
          user: ''
        }
      }
    },
    activated () {
      this.getUserInfo()
    },
    methods: {
      getUserInfo () {
        this.$http({
          url: this.$http.adornUrl('/sys/user/getLoginUserInfo'),
          method: 'POST',
          data: this.$http.adornParams({})
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.dataForm.user = data.user
          }
        })
      }
    }
  }
</script>

<style>
  .mod-home {
    line-height: 1.5;
  }
</style>

